package com.hengpeng.itfints.service;

import com.hengpeng.common.exception.ServiceResult;
import com.hengpeng.itfinbase.message.ResponseMessage;
import com.hengpeng.itfinbase.message.userInfo.UserInfoResponse;
import com.hengpeng.itfinbase.persist.Account;
import com.hengpeng.itfinbase.persist.UserInfo;
import com.hengpeng.itfinbase.persist.VerifyCode.VerifyType;
import com.hengpeng.itfints.vo.MemberSession;

public interface UserService
{
	
	/**
	 * 
	 * <pre>
	 * 刷新SESSION
	 * </pre>
	 * @param userName
	 * @return
	 */
	public MemberSession refreshSessionUser(String userName);

	/**
	 * 根据用户名查询用户信息
	 * @param userName
	 * @return
	 */
	public UserInfo getUserByUserName(String userName);
	
 
	public Account getAccountByUserId(Long userId);

	
	/**
	 * 实名认证
	 * @param request
	 */
	public UserInfoResponse realNameAuth(String userName,String realName,String cardNumber);
	
	/**
	 * 修改密码
	 * @param request
	 */
	public UserInfoResponse updatePassword(String userName,String oldPassword,String password);
	
	/**
     * 找回密码
     * @param request
     */
    public UserInfoResponse backPassword(String mobile,String password);

	/**
	 * 设置密保
	 * @param request
	 */
	public UserInfoResponse doSetQuestion(String userName,String questionType,String answer);
	
	/**
	 * 邮箱验证发送邮件
	 * @param email
	 * @param username
	 * @param url
	 * @param returnUrl
	 * @return
	 */
	public ResponseMessage sendMailForValid(String email, String username,String activeCode,String url, String successUrl, String errorUrl);
	
//	public ResponseMessage sendMailForActive(String email, String username,String activeCode,String url, String returnUrl);

	/**
	 * 邮箱验证邮件确认
	 * @param username
	 * @param verifyCode
	 * @param email
	 * @return
	 */
	public ResponseMessage doValidEmail(String username, String verifyCode, String email);
	
	/**
	 * 短信验证发送
	 * @param mobile
	 * @param username
	 * @param content
	 * @return
	 */
	public ResponseMessage sendSMSForValidMobile(String username, String mobile, String content,VerifyType type);
	
	/**
	 * 验证手机
	 * @param username
	 * @param mobile
	 * @param code
	 * @return
	 */
	public ResponseMessage doValidMobile(String username, String mobile, String code,VerifyType type);
	
	/**
	 * 根据手机号码查询用户
	 * @param mobile
	 * @return
	 */
	public UserInfo getUserByMobile(String mobile);
	
	/**
     * 根据推荐码查询用户
     * @param mobile
     * @return
     */
    public UserInfo getUserByCode(String recommendCode);
	/**
	 * 根据邮箱查询用户
	 * @param email
	 * @return
	 */
	public UserInfo getUserByEmail (String email);
	
	/**
	 * <pre>
	 * 绑定手机号码
	 * </pre>
	 * @param request
	 * @return
	 */
	public ResponseMessage bingMobile(String userName,String mobile);

	/**
	 * 更新邮箱
	 */
	ServiceResult<Object> updateEmail(String userName, String password,
			String email, String newEmail, String reNewEmail);

	/**
	 * 设置邮箱
	 */
    ServiceResult<Object> addEmail(String userName, String password, String newEmail, String reNewEmail);
    /**
     * 修改用户名
     * @param regionalType
     * @return
     */
    public UserInfo updateRealName(Long id,String regionalType);
	
    /**
     * 根据手机号码id查询用户
     * @param mobile
     * @return
     */
    public UserInfo getUserById(Long id);
}
